package com.Endurancer.manager.service.impl;

import java.util.List;
import com.Endurancer.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.Endurancer.manager.mapper.SiteScheduleMapper;
import com.Endurancer.manager.domain.SiteSchedule;
import com.Endurancer.manager.service.ISiteScheduleService;

/**
 * 建站日程Service业务层处理
 * 
 * @author Endurancer
 * @date 2025-02-02
 */
@Service
public class SiteScheduleServiceImpl implements ISiteScheduleService 
{
    @Autowired
    private SiteScheduleMapper siteScheduleMapper;

    /**
     * 查询建站日程
     * 
     * @param scheduleId 建站日程主键
     * @return 建站日程
     */
    @Override
    public SiteSchedule selectSiteScheduleByScheduleId(Long scheduleId)
    {
        return siteScheduleMapper.selectSiteScheduleByScheduleId(scheduleId);
    }

    /**
     * 查询建站日程列表
     * 
     * @param siteSchedule 建站日程
     * @return 建站日程
     */
    @Override
    public List<SiteSchedule> selectSiteScheduleList(SiteSchedule siteSchedule)
    {
        return siteScheduleMapper.selectSiteScheduleList(siteSchedule);
    }

    /**
     * 新增建站日程
     * 
     * @param siteSchedule 建站日程
     * @return 结果
     */
    @Override
    public int insertSiteSchedule(SiteSchedule siteSchedule)
    {
        siteSchedule.setCreateTime(DateUtils.getNowDate());
        return siteScheduleMapper.insertSiteSchedule(siteSchedule);
    }

    /**
     * 修改建站日程
     * 
     * @param siteSchedule 建站日程
     * @return 结果
     */
    @Override
    public int updateSiteSchedule(SiteSchedule siteSchedule)
    {
        siteSchedule.setUpdateTime(DateUtils.getNowDate());
        return siteScheduleMapper.updateSiteSchedule(siteSchedule);
    }

    /**
     * 批量删除建站日程
     * 
     * @param scheduleIds 需要删除的建站日程主键
     * @return 结果
     */
    @Override
    public int deleteSiteScheduleByScheduleIds(Long[] scheduleIds)
    {
        return siteScheduleMapper.deleteSiteScheduleByScheduleIds(scheduleIds);
    }

    /**
     * 删除建站日程信息
     * 
     * @param scheduleId 建站日程主键
     * @return 结果
     */
    @Override
    public int deleteSiteScheduleByScheduleId(Long scheduleId)
    {
        return siteScheduleMapper.deleteSiteScheduleByScheduleId(scheduleId);
    }
}
